Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tableList: {
      type: Array,
      value: [],
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    tableList:[],
    currentTab: 0, 
  },

  /**
   * 组件的方法列表
   */
  methods: {
   
    getRandomColor: function () {
      let rgb = []
      for (let i = 0; i < 3; ++i) {
        let color = Math.floor(Math.random() * 256).toString(16)
        color = color.length == 1 ? '0' + color : color
        rgb.push(color)
      }
      return '#' + rgb.join('')
    },
    //滑动切换
    swiperTab: function (e) {
      var that = this;
      console.log('that')
      that.setData({
        currentTab: e.detail.current
      });
    },
   
    //点击切换
    _clickTab: function (e) {
      var that = this;
      that.setData({
        currentTab: e.target.dataset.current
      })
      this.triggerEvent("clickTab")
    }
  }
})
